package com.xhl.doeverything.entity;//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;

public class SysEvent<T> implements Serializable {
    private static final long serialVersionUID = -4067150528370479764L;
    private SysEventType event;
    private String eventCode;
    private Map<String, String> extra;
    private Date sendTime;
    private List<T> data;

    public SysEvent<T> addData(T item) {
        if (this.data == null) {
            this.data = new ArrayList();
        }

        this.data.add(item);
        return this;
    }

    public SysEvent<T> addDatas(List<T> item) {
        if (this.data == null) {
            this.data = new ArrayList();
        }

        this.data.addAll(item);
        return this;
    }

    public static <T> SysEvent.SysEventBuilder<T> builder() {
        return new SysEvent.SysEventBuilder();
    }

    public SysEventType getEvent() {
        return this.event;
    }

    public String getEventCode() {
        return this.eventCode;
    }

    public Map<String, String> getExtra() {
        return this.extra;
    }

    public Date getSendTime() {
        return this.sendTime;
    }

    public List<T> getData() {
        return this.data;
    }

    public void setEvent(final SysEventType event) {
        this.event = event;
    }

    public void setEventCode(final String eventCode) {
        this.eventCode = eventCode;
    }

    public void setExtra(final Map<String, String> extra) {
        this.extra = extra;
    }

    public void setSendTime(final Date sendTime) {
        this.sendTime = sendTime;
    }

    public void setData(final List<T> data) {
        this.data = data;
    }

    protected boolean canEqual(final Object other) {
        return other instanceof SysEvent;
    }

    public String toString() {
        return "SysEvent(event=" + this.getEvent() + ", eventCode=" + this.getEventCode() + ", extra=" + this.getExtra() + ", sendTime=" + this.getSendTime() + ", data=" + this.getData() + ")";
    }

    public SysEvent() {
    }

    public SysEvent(final SysEventType event, final String eventCode, final Map<String, String> extra, final Date sendTime, final List<T> data) {
        this.event = event;
        this.eventCode = eventCode;
        this.extra = extra;
        this.sendTime = sendTime;
        this.data = data;
    }

    public static class SysEventBuilder<T> {
        private SysEventType event;
        private String eventCode;
        private Map<String, String> extra;
        private Date sendTime;
        private List<T> data;

        SysEventBuilder() {
        }

        public SysEvent.SysEventBuilder<T> event(final SysEventType event) {
            this.event = event;
            return this;
        }

        public SysEvent.SysEventBuilder<T> eventCode(final String eventCode) {
            this.eventCode = eventCode;
            return this;
        }

        public SysEvent.SysEventBuilder<T> extra(final Map<String, String> extra) {
            this.extra = extra;
            return this;
        }

        public SysEvent.SysEventBuilder<T> sendTime(final Date sendTime) {
            this.sendTime = sendTime;
            return this;
        }

        public SysEvent.SysEventBuilder<T> data(final List<T> data) {
            this.data = data;
            return this;
        }

        public SysEvent<T> build() {
            return new SysEvent(this.event, this.eventCode, this.extra, this.sendTime, this.data);
        }

        public String toString() {
            return "SysEvent.SysEventBuilder(event=" + this.event + ", eventCode=" + this.eventCode + ", extra=" + this.extra + ", sendTime=" + this.sendTime + ", data=" + this.data + ")";
        }
    }
}
